package com.stb.client.dialog;

import com.google.gwt.user.client.ui.TextBox;

public class DialogItem 
{
	private final String labelText;
	private final TextBox textBox;
	
	public DialogItem(String labelText, TextBox textBox) {
		this.labelText = labelText;
		this.textBox = textBox;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((labelText == null) ? 0 : labelText.hashCode());
		result = prime * result + ((textBox == null) ? 0 : textBox.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DialogItem other = (DialogItem) obj;
		if (labelText == null) {
			if (other.labelText != null)
				return false;
		} else if (!labelText.equals(other.labelText))
			return false;
		if (textBox == null) {
			if (other.textBox != null)
				return false;
		} else if (!textBox.equals(other.textBox))
			return false;
		return true;
	}

	public TextBox getTextBox() {
		return this.textBox;
	}

	public String getLabelText() {
		return this.labelText;
	}
}
